package com.sikaryofficial.workbench.domain.mapping;

import com.sikaryofficial.workbench.domain.dto.req.goods.CreateOrUpdateGoodsReq;
import com.sikaryofficial.workbench.domain.dto.resp.goods.GoodsManageDetailDTO;
import com.sikaryofficial.workbench.domain.entity.GoodsRelation;
import com.sikaryofficial.workbench.domain.eo.GoodsTasteEO;
import com.sikaryofficial.workbench.domain.vo.goods.GoodsRelationVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author : qinjinyuan
 * @desc : 商品关系实体映射
 * @date : 2023/11/03 9:19
 */
@Mapper
public interface GoodsRelationMapping {
    GoodsRelationMapping INSTANCE = Mappers.getMapper(GoodsRelationMapping.class);

    /**
     * 实体映射VO
     *
     * @param relation
     * @return
     */
    GoodsRelationVO coverToVO(GoodsRelation relation);

    /**
     * 实体映射VO集合
     *
     * @param relation
     * @return
     */
    List<GoodsRelationVO> coverToVOList(List<GoodsRelation> relation);

    /*------------------商品管理---------------*/
    GoodsRelation covertToEntity(CreateOrUpdateGoodsReq.GoodsTaste goodsTaste);

    List<GoodsManageDetailDTO.GoodsTaste> covertToDTOList(List<GoodsRelation> goodsRelationList);
    GoodsManageDetailDTO.GoodsTaste covertToDTO(GoodsRelation goodsRelation);

    List<GoodsRelation> covertToEntityListByEO(List<GoodsTasteEO> tasteEOS);
    GoodsRelation covertToEntityByEO(GoodsTasteEO tasteEO);

    List<GoodsTasteEO> covertToEOList(List<GoodsRelation> goodsRelationList);
}
